package com.thomas.thread;


/**   
* @Description: TODO(用一句话描述该文件做什么) 
* @author thomas_liu  
* @date 2018年5月11日 下午11:11:13 
* @version V1.0   
*/
public class SafeListener {
	
	private final EventListener listener;
	
	
	private SafeListener() {
		listener = new EventListener() {

			public void onEvent(Object object) {
				doSomething(object);
			}

			private void doSomething(Object object) {
				
			}
		};
	}
	
	public static SafeListener newInstance(EventSource source){
		SafeListener safe = new SafeListener();
		source.registerListener(safe.listener);
		return safe;
	}
	
	
}
